#build unity project
def BuildPlayer(projectPath, logFile, buildTarget, bundleId, language, outputPath, streamAllAssets, baseAppRevision, revision, manifestFile, scriptingDefine, buildGameAsset, buildGameUI, fileOperationSet, developmentBuild) :
	if (SwitchUnityTarget(projectPath, logFile, buildTarget) == False) :
		return False
	unityArgs = '-BuildTarget {0} -BundleID {1} -Language {2} -OutputPath {3} -StreamAllAssets {4} -BaseAppRevision {5} -SvnRevision {6} -BuildGameAsset {7} -BuildGameUI {8}'.format(
		buildTarget, bundleId, language, outputPath, streamAllAssets, baseAppRevision, revision, buildGameAsset, buildGameUI, fileOperationSet)
	if fileOperationSet != None and fileOperationSet != '' :
		unityArgs += ' -FileOperationSet {0}'.format(fileOperationSet)
	if scriptingDefine != None  and scriptingDefine != '' :
		unityArgs += ' -ScriptingDefine {0}'.format(scriptingDefine)
	if manifestFile != None  and manifestFile != '' :
		unityArgs += ' -ManifestFile {0}'.format(manifestFile)
	if developmentBuild == True :
		unityArgs += ' -DevelopmentBuild {0}'.format(developmentBuild)
	commandLine = '{0} -batchmode -quit -projectpath {1} -executeMethod KodGames.WorkFlow.BuildTools.BuildPlayer_04 -logfile {2} {3}'.format(unityPath, projectPath, logFile, unityArgs);
	if buildTarget != 'iOS' :
		commandLine +=  ' -nographics'
	print('****************build unity player command line****************')
	print('build unity player commandLine: ' + str(commandLine))
	print('**************************************************************\n')
	if os.system(commandLine) != 0 :
		global unityErrorLog
		unityErrorLog = logFile
		PrintErrorAndRaiseExpetion('build player failed')
		return False;
	return True
#-----------------------------------------

